<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>渲染图片</title>
</head>
<body>
    <div id="change" class="change">
        <img data-bind:src="imgUrl" alt="">
    </div>

    <script>
        let imgUrl = "https://www.cmse.gov.cn/xwzx/202511/W020251101161154105825.jpg"

        let element = document.querySelector("#change > img")
        console.log(element);

        let attributes = element.getAttributeNames()
        for (let index = 0; index < attributes.length; index++) {
            if ('data-bind:src' === attributes[index]) {
                let attributeValue = element.getAttribute(attributes[index])

                element.removeAttribute(attributes[index])
                let results =  attributes[index].split(":")
                element.setAttribute(results[results.length - 1], eval(attributeValue))
            }
            
        }
        
    </script>
</body>
</html>